For this set of exercises as well as all following ones, we suggest that you write R scripts (one per set of exercises or a combined one for the whole course) and store them in the my_scripts folder contained in the course materials. This folder already contains a script stub called my_script.R which you can use for getting started.

1

To explore what R packages are out there that may be of interest for you, have a look at the CRAN Task View section called SocialSciences and do a quick search for “regression” on METACRAN.
Although it may be tempting (there are so many interesting packages!), try not to spend more than 2 to 3 minutes on this (for now).

2

The first simple coding task for this exercise is to install a few packages from CRAN (we will use those later on in the course). Please install the following packages: remotes, dplyr, janitor, correlation (Note: We will need a few more packages throughout this course, but we do not have to install all of them now).

3

Now, let’s load one of the packages you have just installed. Load the remotes package.

4

Some packages are not on CRAN. Another important source of R packages is GitHub (especially for development versions). So, let’s install a package from there. Install the emo package from GitHub. NB: To be able to install packages from GitHub on Windows machines, you will need to install Rtools first.
You can use a function from the remotes package for this.

5

Check which packages are now installed on your system.
You can use the RStudio interface or a function for this.

6

As a final exercise, add some comments to your script.
Comments in R start with #. Ideally, these should explain what the code you have written does.